# _*_ coding: utf-8 _*_
import random
import os
import datetime


class BusinessOperate():
    """
    这个是用于封装一些常用随机数据的生成
    """

    @staticmethod  # 静态方法，可以不需要实例化调用,去掉self
    def getChinsesName():
        firstWord = '赵钱孙李周吴郑王冯陈褚卫蒋沈韩杨朱秦尤许何吕施张孔曹严华金魏陶姜'
        middleWord = '赵钱孙李周吴郑王冯陈褚卫蒋沈韩杨朱秦尤许何吕施张孔曹严华金魏陶姜'
        lastWord = '赵钱孙李周吴郑王冯陈褚卫蒋沈韩杨朱秦尤许何吕施张孔曹严华金魏陶姜'
        firstName = random.choice(firstWord)
        middleName = random.choice(middleWord)
        lastName = random.choice(lastWord)
        xxName = firstName + middleName + lastName
        return xxName

    @staticmethod
    def getMobilePhone():
        prelist = ["130", "131", "132", "133", "134", "135", "136", "137", "138", "139", "147", "150", "151", "152",
                   "153", "155", "156", "157", "158", "159", "186", "187", "188"]
        xxPhone = random.choice(prelist) + "".join(random.choice("0123456789") for i in range(8))
        return xxPhone

    @staticmethod
    def getEmail():
        emailtype = ["@qq.com", "@163.com", "@126.com", "@189.com"]
        randomEmail = random.choice(emailtype)
        rang = random.randint(4, 10)
        number = "0123456789qbcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPWRSTUVWXYZ"
        randomNumber = "".join(random.choice(number) for i in range(rang))
        xxEmail = randomNumber + randomEmail
        return xxEmail

    @staticmethod
    def getDate():
        currentDate = datetime.datetime.now().strftime('%Y-%m-%d')
        return currentDate

    @staticmethod
    def getTime():
        curentTime = datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S')
        return curentTime

    @staticmethod
    def getAddTime():
        days = random.randint(2, 10)
        curentTime = (datetime.datetime.now() + datetime.timedelta(days=days)).strftime('%Y-%m-%d %H:%M:%S')
        return curentTime

    @staticmethod
    def getDateNumber():
        curentDateNumber = datetime.datetime.now().strftime('%Y%m%d')
        return curentDateNumber


if __name__ == '__main__':
    print(BusinessOperate.getChinsesName())
    print(BusinessOperate.getEmail())
    print(BusinessOperate.getMobilePhone())
    print(BusinessOperate.getTime())
    print(BusinessOperate.getDate())
    print(BusinessOperate.getDateNumber())
    print(BusinessOperate.getDateNumber())
    print(BusinessOperate.getAddTime())
